﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using Microsoft.ApplicationBlocks.Data;
using System.Data;

namespace HttpAssiant
{
    class DbHelperSQL
    {
        private static string ConnectionString = "server=127.0.0.1;Integrated Security=True;Initial Catalog=jfdh;Pooling=true";
        public static int ExecuteSql(string p, SqlParameter[] parameters)
        {
            return SqlHelper.ExecuteNonQuery(ConnectionString,CommandType.Text,p,parameters);
        }

        public static object GetSingle(string p, SqlParameter[] parameters)
        {
            return SqlHelper.ExecuteScalar(ConnectionString,CommandType.Text,p,parameters);
        }

        public static int ExecuteSql(string p)
        {
            return SqlHelper.ExecuteNonQuery(ConnectionString,CommandType.Text,p);
        }

        public static DataSet Query(string p, SqlParameter[] parameters)
        {
            return SqlHelper.ExecuteDataset(ConnectionString,CommandType.Text,p,parameters);
            
        }

        public static System.Data.DataSet Query(string p)
        {
            return SqlHelper.ExecuteDataset(ConnectionString,CommandType.Text, p);
        }

        public static object GetSingle(string p)
        {
            return SqlHelper.ExecuteScalar(ConnectionString,CommandType.Text,p);
        }

    }
}
